<template>
	<view>
		<view class="status_bar" />
		<view style="height: 45px;display: flex;align-items: center;justify-content: space-between;padding:0 10px 0 3px;position: relative;background-color: white;">
			<u-icon @click="back" :name="left" color="#373737" size="30"></u-icon>
			<u--text size="17" :text="title" lines="1" style="flex: 1;padding-left: 10px;" v-if="title!=null"></u--text>
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String
			},
			left: {
				type: String,
				default: "arrow-left"
			},
		},
		name: "navbar",
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style>
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
		background-color: #ffffff;
	}
</style>